# coding=utf-8
from flask_wtf import FlaskForm
import wtforms
from wtforms import validators


class VersionAddForm(FlaskForm):
    app = wtforms.StringField(u'名称', [validators.data_required(u'名称不能为空')])
    url = wtforms.StringField(u'版本地址', [validators.data_required(u'版本地址不能为空')])
    channel_id = wtforms.StringField(u'渠道', [validators.data_required(u'渠道不能为空')])
    ver_code = wtforms.IntegerField(u'版本号', [validators.data_required(u'版本号必须为数字')])
    ver_name = wtforms.StringField(u'版本名称', [validators.data_required(u'版本名称不能为空')])
    apk_size = wtforms.FloatField(u'文件大小(MB)', [validators.data_required(u'文件大小必须为数字')])
    force = wtforms.RadioField(u'强制更新', choices=[(0, u'禁用'), (1, u'启用')], default=1, coerce=int)


class AnnouncementAddForm(FlaskForm):
    title = wtforms.StringField(u'标题', [validators.data_required(u'标题不能空')])
    content = wtforms.TextAreaField(u'内容', [validators.data_required(u'内容不能为空')])
    image_url = wtforms.StringField(u'图片地址')
    status = wtforms.RadioField(u'状态', choices=[(0, u'禁用'), (1, u'启用')], default=1, coerce=int)
